﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace GameStateManagement
{
    class IMenuElement 
    {

        SpriteFont element;
        Vector2 element_position;
        Vector2 element_orgin;
        Vector2 position;
        Color element_color;
        float element_scale = 1.25f;
        String string_element;
        String font_name;

        protected SpriteBatch spriteBatch;
        protected ContentManager content;

        public SpriteBatch SpriteBatch
        {
            set { spriteBatch = value; }
        }

        public ContentManager ContentManager
        {
            set { content = value; }
        }

        public IMenuElement(String font_name, String string_element, Vector2 position)
        {
            this.font_name = font_name;
            this.string_element = string_element;
            this.position = position;
        }


        public void LoadContent()
        {
            element = content.Load<SpriteFont>(font_name);

            element_position = new Vector2(position.X, position.Y);
            element_orgin = element.MeasureString(string_element) / 2;

            element_color = Color.Black;
        }


        public void Draw()
        {
            spriteBatch.DrawString(element, string_element, element_position, element_color, 0,
                                   element_orgin, element_scale, SpriteEffects.None, 0);
        }


    }

}
